import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class ConnectorBD {

	protected Connection connexio = null;
	
		public ConnectorBD(){
			
			//System.out.println("driver encara NO carregat");
			// carreguem el driver
			try {
				Class.forName("com.mysql.jdbc.Driver").newInstance();
			} catch (InstantiationException e) {			
				e.printStackTrace();
			} catch (IllegalAccessException e) {			
				e.printStackTrace();
			} catch (ClassNotFoundException e) {			
				e.printStackTrace();
			}
		}
		
		public Connection conectar() throws SQLException{
			
			// System.out.println("driver carregat");
			connexio=DriverManager.getConnection("jdbc:mysql://localhost:3306/c13", "root", "");
			return connexio;
		}
}
